<?php // no direct access
defined('_JEXEC') or die('Restricted access');

    $tydny_arr = $this->tydny;
    $tydny_obj_list = $tydny_arr['tydny_obj_list'];
    $rok_str = $tydny_arr['rok_str'];
    $nastaveni_obj = $tydny_arr['nastaveni'];
    $nadpis = '';
    if (is_object($nastaveni_obj)) {
        $nadpis = $nastaveni_obj->nadpis_hlavni;
    }
    $chyba = $tydny_arr['chyba'];
    echo '<h1>'.$nadpis.' '.$rok_str.'</h1>';
   
    if (empty($chyba)) {

        //$link= JRoute::_('index.php?option=com_ohlasky&tyden_id_int='.JRequest::getVar('tyden_id_int', NULL));
        ?>
        <table>
<form action="" method="post" name="Form">
    <tr>
    <td>
    <select name="tyden_id_int">

    <?php
    foreach ($tydny_obj_list as $tyden_obj) {

        $ode_dne_old = $tyden_obj->ode_dne;
        $datetime = new DateTime($ode_dne_old);
        $ode_dne_new = $datetime->format('j. n. Y');
        $radek_selectu = 'týden od '.$ode_dne_new;
        echo '<option value="'.$tyden_obj->id.'">'.$radek_selectu;
    }
    ?>
    </select>
    </td>
    <td>
    <input type="hidden" name="option" value="com_ohlasky" />
    <input type="hidden" name="task" value="show" />
    <input type="hidden" name="controller" value="tydny" />
    <input type="submit" value="zobrazit">
    </td>
    </tr>
</form>
</table>
<?php
} else {
echo '<p>'.$chyba.'</p>';
}




